package th.kmutt.se.is.model;

import android.content.Context;
import android.database.DatabaseUtils.InsertHelper;
import android.provider.ContactsContract.Contacts.Data;
import th.kmutt.se.is.fact.Database;

/**
 * @author pathpert
 *
 */
public class Tenant {
	
	private int id;
	private String name;
	private String surname;
	private String personalNo;
	private String phone;
	private String email;
	private String signedDate;
	private String terminatedDate;
	
	private static Context context;
	private static Database db;
	
	
	public Tenant(Context c){
		context = c;
		db = new Database(context);
	}
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getSurname() {
		return surname;
	}
	public void setSurname(String surname) {
		this.surname = surname;
	}
	public String getPersonalNo() {
		return personalNo;
	}
	public void setPersonalNo(String personalNo) {
		this.personalNo = personalNo;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getSignedDate() {
		return signedDate;
	}

	public void setSignedDate(String signedDate) {
		this.signedDate = signedDate;
	}

	public String getTerminatedDate() {
		return terminatedDate;
	}

	public void setTerminatedDate(String terminatedDate) {
		this.terminatedDate = terminatedDate;
	}

	public boolean create(){
		db.openToWrite();
		InsertHelper ih = new InsertHelper(db.sqLiteDatabase, Database.TB_R_TENANT);
		final int colName = ih.getColumnIndex(Database.KEY_NAME);
		final int colSurname = ih.getColumnIndex(Database.KEY_SURNAME);
		final int colPno = ih.getColumnIndex(Database.KEY_PNO);
		final int colPhone = ih.getColumnIndex(Database.KEY_PHONE);
		final int colEmail = ih.getColumnIndex(Database.KEY_EMAIL);
		db.close();
		return true;
	}
	
	public boolean update(){
		return true;
	}
	
	public boolean delete(){
		return true;
	}
	
}
